package org.dtrd.modules.patient.entity.bean.miniprogram;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.dtrd.config.system.Constant;
import org.dtrd.modules.achievement.entity.bean.PatientSigninRecord;
import org.dtrd.modules.achievement.entity.bean.WeekRecordSummary;
import org.dtrd.modules.doctor.entity.bean.TeamDoctorInfo;
import org.dtrd.modules.patient.entity.po.DtrdEntRdPatient;
import org.dtrd.modules.record.entity.bean.SigninSuggestBean;
import org.dtrd.modules.service.entity.bean.ServiceDetailItem;

import java.util.List;

/**
 * @author qr
 * @date 2022/3/16 13:42
 */
@ApiModel
@Data
@Slf4j
public class PatientMiniProgramIndexInfo {

    @ApiModelProperty("标题")
    private String title = Constant.COMPANY_NAME;

    @ApiModelProperty("患者id")
    private Integer patientId;

    @ApiModelProperty("姓名")
    private String patientName;

    @ApiModelProperty("头像")
    private String patientAvatar;

    @ApiModelProperty("打卡状况")
    private PatientMiniProgramSigninStatus signinStatus;

    @ApiModelProperty("打卡完成率")
    private String signinFinishedRate = "—";

    @ApiModelProperty("打卡达标率")
    private String signinReachStandardRate = "—";

    @ApiModelProperty("最新数据")
    private PatientMiniProgramLatestData latestData;

    @ApiModelProperty("设备绑定信息")
    private PatientMiniProgramLatestData deviceBindInfo;

    @ApiModelProperty("机构详情")
    private String orgDetailUrl;

    @ApiModelProperty("医生团队信息")
    private List<TeamDoctorInfo> doctorInfos;

    @ApiModelProperty("医生id")
    private Integer doctorId;

    @ApiModelProperty("建议内容")
    private List<SigninSuggestBean> suggests;

    @ApiModelProperty("控制目标内容")
    private List<WeekRecordSummary> targets;

    @ApiModelProperty("服务状态, 0-没有服务, 1-服务中, 2-服务未开始, 3-已结束")
    private Integer serviceStatus = 0;

    @ApiModelProperty("服务包id")
    private Integer packageId;

    @ApiModelProperty("最新的三条未完成服务")
    private List<ServiceDetailItem> services;

    @ApiModelProperty("患者进入打卡")
    private List<PatientSigninRecord> patientSigninRecords;

    public PatientMiniProgramIndexInfo parseFromPO(DtrdEntRdPatient po) {
        this.patientId = po.getDataId();
        this.patientName = po.getPatientsName();
        this.patientAvatar = po.getPatientsImg();
        return this;
    }
}
